package com.kuhnwei.examples.datastructure.linkedlist.simple;

import java.util.Arrays;

/**
 * Created by Kuhn on 2017/8/15.
 */
public class _Main {
    public static void main(String[] args) {
        Link link = new LinkImpl();
        link.add("A");
        link.add("B");
        link.add("C");
        link.add("D");
        link.add("E");
        link.add("F");
        link.add("G");
        print(link);
        link.set(3, "X");
        print(link);
        link.remove("X");
        print(link);
        System.out.println(link.get(1));
        System.out.println(link.contains("F"));
        link.clear();
        print(link);

    }
    public static void print(Link link) {
        System.out.println(link.isEmpty());
        System.out.println(link.size());
        System.out.println(Arrays.toString(link.toArray()));
    }
}
